he R library for the Smith-Waterman algorithm

rwiseAlignment function of the Biostrings can also be

employing the Smith-Waterman algorithm for a local pair-wise

y sequence alignment depending on the design of a properly

substitution matrix, a gap opening penalty and a gap extension

Aligning the above two RNA sequences using the Smith-

n algorithm is shown below. First the RNAString function was

define two RNA sequences

String('GCAUUGA')

String('AACUCU')

a substitution matrix was defined. All the diagonal entries of this

on matrix were filled by one and all off-diagonal entries were

-0.3. To do this, the following code was used. Table 7.17 shows

itution matrix used by the Smith-Waterman algorithm.

atrix(-0.3,nrow=4,ncol=4)

ubs)=1

es(subs)=colnames(subs)=RNA_ ALPHABET[1:4]

Table 7.17. Forward propagation result.

A

C

G

U

A

1

-0.3

-0.3

-0.3

C

-0.3

1

-0.3

-0.3

G

-0.3

-0.3

1

-0.3

U

-0.3

-0.3

-0.3

1

airwiseAlignment function was then called. The definition

arameters (gapOpening and gapExtension) were assigned

−0.3.

pairwiseAlignment(s1,s2,type='local',

ubstitutionMatrix=subs,gapOpening=-1.3,

gapExtension=-0.3)